var RequestError = function () {
  var template = /* html */ `
    <div class="request-error">
      <div class="request-error-title">
        <span>订单未审核或未发料</span>
      </div>
      <div class="order-info clearfix">
        <div>系统订单编号:{{order.orderId}}</div>
        <div v-if="order.companyOrderId!==''">公司订单编号:{{order.companyOrderId}}</div>
        <div v-if="order.factoryId!==''">工厂型号:{{order.factoryId}}</div>
        <div v-if="order.customerId!==''">公司订单编号:{{order.customerId}}</div>
      </div>
      <div style="margin-bottom:5px;color:#ff0000" v-if="noFeedMaterialList.length>0">
        未发料物料类型：{{noFeedMaterialList.join(', ')}}
      </div>
      <div class="request-error-table-div">
        <el-table fit stripe border :data="detailList" style="width:100%" height="parent">
          <el-table-column label="类型" prop="statusStr" min-width="100px" align="center"></el-table-column>
          <el-table-column label="制单人" prop="createUser" min-width="120px" header-align="center"></el-table-column>
          <el-table-column label="制单时间" width="100px" align="center">
            <template slot-scope="scope">
              <span>{{moment(scope.row.touchTime).format('YYYY-MM-DD')}}</span>
            </template>
          </el-table-column>
          <el-table-column label="可审核人" min-width="130px" header-align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.approvalUserName.length>0">
                {{scope.row.approvalUserName.join(', ')}}
              </span>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
  `;

  return {
    props: {
      errorData: {
        type: Object,
        required: true
      }
    },

    data: function () {
      var errorData = this.errorData;
      return {
        order: errorData.order,
        detailList: errorData.detailList,
        noFeedMaterialList: errorData.noFeedMaterialList,
        type: errorData.type,
        moment: moment
      };
    },

    template: template
  };
}();
